stack: Build stored render node with custom Snapshot object
authorBenjamin Otte <otte@redhat.com>
Thu, 12 Jan 2017 21:49:53 +0000 (22:49 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 13 Jan 2017 02:38:36 +0000 (03:38 +0100)
This is in preparation for API changes in GtkSnapshot.

gtk/gtkstack.c

index b1448f28b703f79323208aa07ae19987688c9143..0e4e46372ff8820b56a1052a1dd6f2898a39cccd 100644 (file)
@@ -2093,11 +2093,17 @@ gtk_stack_render (GtkCssGadget *gadget,
           if (priv->last_visible_node == NULL &&
               priv->last_visible_child != NULL)
             {
+              GtkSnapshot last_visible_snapshot;
+
               gtk_widget_get_allocation (priv->last_visible_child->widget,
                                          &priv->last_visible_surface_allocation);
-              gtk_snapshot_push (snapshot, FALSE, "StackCaptureLastVisibleChild");
-              gtk_widget_snapshot (priv->last_visible_child->widget, snapshot);
-              priv->last_visible_node = gtk_snapshot_pop (snapshot);
+              gtk_snapshot_init (&last_visible_snapshot,
+                                 gtk_snapshot_get_renderer (snapshot),
+                                 snapshot->record_names,
+                                 NULL,
+                                 "StackCaptureLastVisibleChild");
+              gtk_widget_snapshot (priv->last_visible_child->widget, &last_visible_snapshot);
+              priv->last_visible_node = gtk_snapshot_finish (&last_visible_snapshot);
             }
 
           gtk_snapshot_push_clip (snapshot,